
import request from "@/util/request";
import {flaskURL, currentUser} from "@/global";

export const uploadImgAPI = (file) => {
    const formData = new FormData()
    formData.append('file', file)
    formData.append('username', currentUser.value.name)
    return request.post(flaskURL + "/upload", formData)
}

export const imgOcrAPI = (path) => {
    const formData = new FormData()
    formData.append('path', path)
    return request.post(flaskURL + "/ocr", formData)
}

export const transformPdfAPI = (file) => {
    return request.post("/ocr/pdf", file);
}

export const transformPptAPI = (file) => {
    return request.post("/ocr/ppt", file)
}

export const transformWordAPI = (file) => {
    return request.post("/ocr/word", file)
}
